<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js</title>
</head>
<body>
	<!--跳转删除实例-->
	<h1>用户管理</h1>
	<?php
	//用php去数据库获取数据
	$pdo=new PDO('mysql:host=localhost;dbname=travel','root','');
	$pdo->exec('set names utf8');
	$sql="select * from trl_user_info";
	$smt=$pdo->query($sql);
	$rows=$smt->fetchAll(PDO::FETCH_ASSOC);
	/*echo "<pre>";
	print_r($rows);
	echo "</pre>";*/
	?>
	<table width='1000px' border='1px' cellspacing='0'>
		<tr>
			<th>ID</th>
			<th>用户名</th>
			<th>手机号</th>
			<th>删除</th>
		</tr>
		<?php 
			foreach($rows as $row){
				echo "<tr>";
				echo "<td>{$row['id']}</td>";
				echo "<td>{$row['nickname']}</td>";
				echo "<td>{$row['phone']}</td>"; 
				echo "<td><a href='delete.php?id={$row['id']}'>删除</a></td>"; 
				echo "</tr>";
			}
		?>
	</table>
</body>
</html>